import request from '@/utils/request'
import type { TrademarkInfoModel, TrademarkListDataModel } from './model/trademarkModel'

enum Api{
  // 获取品牌
  getTrademarkListApi = '/admin/product/baseTrademark',
  // 新增品牌
  saveTrademarkListApi = '/admin/product/baseTrademark/save',
  // 更新品牌
  updateTrademarkInfoApi = '/admin/product/baseTrademark/update',
  // 删除品牌
  removeTrademarkListApi = '/admin/product/baseTrademark/remove'
}

// 获取品牌列表的接口函数
export const reqGetTrademarkListData = (page:number,limit:number)=>
  request.get<any,TrademarkListDataModel>(`/admin/product/baseTrademark/${page}/${limit}`)

// 新增品牌列表的接口函数
export const reqSaveTrademarkInfo = (trademarkInfo:TrademarkInfoModel)=>
  request.post(Api.saveTrademarkListApi,trademarkInfo)

// 更新品牌列表的接口函数
export const reqUpdateTrademarkInfo = (trademarkInfo:TrademarkInfoModel) => 
  request.put(Api.updateTrademarkInfoApi,trademarkInfo)
// 删除品牌列表的接口函数
export const reqRemoveTrademarkInfo = (id: number) =>
request.delete(Api.removeTrademarkListApi + `/${id}`)